package com.one.blocks.rbac.controller.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.one.blocks.common.valid.constraints.EnumContains;
import com.one.blocks.mvc.domain.Id;
import com.one.blocks.mvc.valid.Update;
import com.one.blocks.mvc.valid.UpdateSelective;
import com.one.blocks.rbac.enums.RoleTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.groups.Default;
import java.io.Serializable;

/**
 * @author <a href="mailto:idler41@163.con">idler41</a> created on 2023-10-25 10:50:39
 */
@ApiModel(value = "系统角色")
@Data
public class SysRoleVo implements Id<Integer>, Serializable {
    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID")
    @NotNull(groups = {UpdateSelective.class, Update.class})
    @Null(groups = Default.class)
    private Integer id;
    /**
     * 角色名称
     */
    @ApiModelProperty(value = "角色名称")
    @NotNull(groups = {Default.class, Update.class})
    private String name;
    /**
     * 角色类型: 0-普通角色 10-微信注册默认角色 100-系统管理员
     */
    @ApiModelProperty(value = "角色类型: 0-普通角色 10-微信注册默认角色 100-系统管理员")
    @NotNull(groups = {Default.class, Update.class})
    @EnumContains(RoleTypeEnum.class)
    private Integer type;

    /**
     * 角色状态: 0-禁用 1-正常
     */
    @ApiModelProperty(value = "角色状态: 0-禁用 1-正常")
    private Integer state;
    /**
     * 创建者id
     */
    @ApiModelProperty(value = "创建者id", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer createId;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Long createTime;
    /**
     * 更新者id
     */
    @ApiModelProperty(value = "更新者id", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer updateId;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Long updateTime;
}